 1.Hadoop二次开发环境搭建
   
   系统环境:
   系统： CentOS-7_x86_64
   protobuf: protoc-2.5.0
   maven： maven-3.6.0
   hadoop: hadoop-2.9.2
   java： jdk1.8.0_131
   cmake: cmake-2.8.12.2
   OpenSSL: OpenSSL 1.0.2k-fips
   findbugs： findbugs-1.3.9
 
 2.准备工作
   
   # 安装编译需要的依赖库
   yum install -y lzo-devel zlib-devel autoconf automake libtool cmake openssl-devel cmake gcc gcc-c++
 
 3.安装Maven
   
   #上传maven安装包
   # 解压缩
   $ tar -zxvf apache-maven-3.6.3-bin.tar.gz -C /usr/local/
   # 配置到系统环境变量
   $ vim /etc/profile
   
   export MAVEN_HOME=/usr/local/apache-maven-3.6.3
   export PATH=$PATH:$MAVEN_HOME/bin
   
   # 刷新配置文件
   $ source /etc/profile
   
   [root@localhost ~]# mvn -version
   Apache Maven 3.6.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2018-10-
   25T03:39:06+08:00)
   Maven home: /usr/local/apache-maven-3.6.3
   Java version: 1.8.0_131, vendor: Oracle Corporation
   Java home: /usr/local/jdk1.8.0_131/jre
   Default locale: en_US, platform encoding: UTF-8
   OS name: "linux", version: "4.20.13-1.el7.elrepo.x86_64", arch: "amd64", family:
   "unix"
 
 4.安装protobuf
   
   # 安装依赖环境
   $ yum groupinstall Development tools -y
   
   # 下载
   $ https://github.com/protocolbuffers/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.gz
   #上传protobuf安装包
   # 解压缩
   $ tar -zxvf protobuf-2.5.0.tar.gz
   cd protobuf-2.5.0
   # 进入解压目录 配置安装路径（--prefix=/usr/local/protobuf-2.5.0）
   $ ./configure --prefix=/usr/local/protobuf-2.5.0
   # 编译
   $ make
   # 验证编译文件
   $ make check
   # 安装
   $ make install
   # 配置protobuf环境变量
   $ vim /etc/profile
   
   export PROTOCBUF_HOME=/usr/local/protobuf-2.5.0
   export PATH=$PATH:$PROTOCBUF_HOME/bin
   
   # 验证是否安装成功
   $ protoc --version
   
   [root@localhost ~]# protoc --version
   libprotoc 2.5.0
 
 5.安装Findbugs
   
   #下载
   $ https://jaist.dl.sourceforge.net/project/findbugs/findbugs/1.3.9/findbugs-1.3.9.tar.gz
   #上传安装包
   # 解压缩
   $ tar -zxvf findbugs-1.3.9.tar.gz -C /usr/local/
   
   # 配置系统环境变量
   $ vim /etc/profile
   export FINDBUGS_HOME=/usr/local/findbugs-1.3.9
   export PATH=$PATH:$FINDBUGS_HOME/bin
   # 刷新配置文件
   $ source /etc/profile
   # 验证是否安装成功
   $ findbugs -version
   [root@localhost ~]# findbugs -version
   1.3.9
   
 6.添加aliyun镜像
   
   找到maven环境下的settings.xml文件，添加镜像代理
   <mirror>
     <id>nexus</id>
     <mirrorOf>*</mirrorOf>
     <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
   </mirror>
   <mirror>
     <id>nexus-public-snapshots</id>
     <mirrorOf>public-snapshots</mirrorOf>
     <url>http://maven.aliyun.com/nexus/content/repositories/snapshots/</url>
   </mirror>
 
 7.上传源码文件
   
   进入代码文件目标路径
   /root/hadoop-2.9.2-src/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-
mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/input
  
  通过rz命令上传文件代码
  进入Hadoop源码目录
  cd /root/hadoop-2.9.2-src 
  执行编译命令
  mvn package -Pdist,native -DskipTests -Dtar
  问题解决
  hadoop-aws:jar时缺少依赖包DynamoDBLocal:jar
  选择手动下载该Jar包，上传到本地maven仓库
  cd /root/.m2/repository/com/
  进入这个目录  然后进行创建
  mkdir -p amazonaws/DynamoDBLocal/1.11.86
  cd amazonaws/DynamoDBLocal/1.11.86/
  然后重新执行编译命令
  mvn package -Pdist,native -DskipTests -Dtar
  
  执行成功的标志
[INFO] Reactor Summary for Apache Hadoop Main 2.9.2:
[INFO]
[INFO] Apache Hadoop Main ................................. SUCCESS [ 1.165 s]
[INFO] Apache Hadoop Build Tools .......................... SUCCESS [ 0.747 s]
[INFO] Apache Hadoop Project POM .......................... SUCCESS [ 0.808 s]
[INFO] Apache Hadoop Annotations .......................... SUCCESS [ 1.773 s]
[INFO] Apache Hadoop Assemblies ........................... SUCCESS [ 0.202 s]
[INFO] Apache Hadoop Project Dist POM ..................... SUCCESS [ 1.468 s]
[INFO] Apache Hadoop Maven Plugins ........................ SUCCESS [ 2.847 s]
[INFO] Apache Hadoop MiniKDC .............................. SUCCESS [ 3.001 s]
[INFO] Apache Hadoop Auth ................................. SUCCESS [ 4.041 s]
[INFO] Apache Hadoop Auth Examples ........................ SUCCESS [ 2.509 s]
[INFO] Apache Hadoop Common ............................... SUCCESS [ 49.423 s]
[INFO] Apache Hadoop NFS .................................. SUCCESS [ 3.809 s]
[INFO] Apache Hadoop KMS .................................. SUCCESS [ 10.492 s]
[INFO] Apache Hadoop Common Project ....................... SUCCESS [ 0.063 s]
[INFO] Apache Hadoop HDFS Client .......................... SUCCESS [ 12.434 s]
[INFO] Apache Hadoop HDFS ................................. SUCCESS [ 37.065 s]
[INFO] Apache Hadoop HDFS Native Client ................... SUCCESS [ 1.951 s]
[INFO] Apache Hadoop HttpFS ............................... SUCCESS [ 15.952 s]
[INFO] Apache Hadoop HDFS BookKeeper Journal .............. SUCCESS [ 3.922 s]
[INFO] Apache Hadoop HDFS-NFS ............................. SUCCESS [ 3.316 s]
[INFO] Apache Hadoop HDFS-RBF ............................. SUCCESS [ 15.651 s]
[INFO] Apache Hadoop HDFS Project ......................... SUCCESS [ 0.041 s]
[INFO] Apache Hadoop YARN ................................. SUCCESS [ 0.050 s]
[INFO] Apache Hadoop YARN API ............................. SUCCESS [ 8.927 s]
[INFO] Apache Hadoop YARN Common .......................... SUCCESS [01:10 min]
[INFO] Apache Hadoop YARN Registry ........................ SUCCESS [ 4.114 s]
[INFO] Apache Hadoop YARN Server .......................... SUCCESS [ 0.040 s]
[INFO] Apache Hadoop YARN Server Common ................... SUCCESS [ 9.403 s]
[INFO] Apache Hadoop YARN NodeManager ..................... SUCCESS [ 18.255 s]
[INFO] Apache Hadoop YARN Web Proxy ....................... SUCCESS [ 2.929 s]
[INFO] Apache Hadoop YARN ApplicationHistoryService ....... SUCCESS [ 5.629 s]
[INFO] Apache Hadoop YARN Timeline Service ................ SUCCESS [ 4.198 s]
[INFO] Apache Hadoop YARN ResourceManager ................. SUCCESS [ 37.668 s]
[INFO] Apache Hadoop YARN Server Tests .................... SUCCESS [ 0.762 s]
[INFO] Apache Hadoop YARN Client .......................... SUCCESS [ 4.561 s]
[INFO] Apache Hadoop YARN SharedCacheManager .............. SUCCESS [ 3.043 s]
[INFO] Apache Hadoop YARN Timeline Plugin Storage ......... SUCCESS [ 2.427 s]
[INFO] Apache Hadoop YARN Router .......................... SUCCESS [ 3.277 s]
[INFO] Apache Hadoop YARN TimelineService HBase Backend ... SUCCESS [ 5.804 s]
[INFO] Apache Hadoop YARN Timeline Service HBase tests .... SUCCESS [ 1.815 s]
[INFO] Apache Hadoop YARN Applications .................... SUCCESS [ 0.040 s]
[INFO] Apache Hadoop YARN DistributedShell ................ SUCCESS [ 2.236 s]
[INFO] Apache Hadoop YARN Unmanaged Am Launcher ........... SUCCESS [ 1.769 s]
[INFO] Apache Hadoop YARN Site ............................ SUCCESS [ 0.045 s]
[INFO] Apache Hadoop YARN UI .............................. SUCCESS [ 0.046 s]
[INFO] Apache Hadoop YARN Project ......................... SUCCESS [ 6.043 s]
[INFO] Apache Hadoop MapReduce Client ..................... SUCCESS [ 0.180 s]
[INFO] Apache Hadoop MapReduce Core ....................... SUCCESS [ 59.165 s]
[INFO] Apache Hadoop MapReduce Common ..................... SUCCESS [ 28.713 s]
[INFO] Apache Hadoop MapReduce Shuffle .................... SUCCESS [ 3.509 s]
[INFO] Apache Hadoop MapReduce App ........................ SUCCESS [ 9.007 s]
[INFO] Apache Hadoop MapReduce HistoryServer .............. SUCCESS [ 4.384 s]
[INFO] Apache Hadoop MapReduce JobClient .................. SUCCESS [ 3.720 s]
[INFO] Apache Hadoop MapReduce HistoryServer Plugins ...... SUCCESS [ 1.733 s]
[INFO] Apache Hadoop MapReduce Examples ................... SUCCESS [ 3.492 s]
[INFO] Apache Hadoop MapReduce ............................ SUCCESS [ 3.083 s]
[INFO] Apache Hadoop MapReduce Streaming .................. SUCCESS [ 3.086 s]
[INFO] Apache Hadoop Distributed Copy ..................... SUCCESS [ 6.657 s]
[INFO] Apache Hadoop Archives ............................. SUCCESS [ 1.497 s]
[INFO] Apache Hadoop Archive Logs ......................... SUCCESS [ 1.641 s]
[INFO] Apache Hadoop Rumen ................................ SUCCESS [ 3.512 s]
[INFO] Apache Hadoop Gridmix .............................. SUCCESS [ 3.253 s]
[INFO] Apache Hadoop Data Join ............................ SUCCESS [ 1.906 s]
[INFO] Apache Hadoop Ant Tasks ............................ SUCCESS [ 1.669 s]
[INFO] Apache Hadoop Extras ............................... SUCCESS [ 2.252 s]
[INFO] Apache Hadoop Pipes ................................ SUCCESS [ 0.319 s]
[INFO] Apache Hadoop OpenStack support .................... SUCCESS [ 2.962 s]
[INFO] Apache Hadoop Amazon Web Services support .......... SUCCESS [ 7.011 s]
[INFO] Apache Hadoop Azure support ........................ SUCCESS [ 5.998 s]
[INFO] Apache Hadoop Aliyun OSS support ................... SUCCESS [ 4.510 s]
[INFO] Apache Hadoop Client ............................... SUCCESS [ 5.978 s]
[INFO] Apache Hadoop Mini-Cluster ......................... SUCCESS [ 0.536 s]
[INFO] Apache Hadoop Scheduler Load Simulator ............. SUCCESS [ 3.995 s]
[INFO] Apache Hadoop Resource Estimator Service ........... SUCCESS [ 4.019 s]
[INFO] Apache Hadoop Azure Data Lake support .............. SUCCESS [ 3.439 s]
[INFO] Apache Hadoop Tools Dist ........................... SUCCESS [ 18.642 s]
[INFO] Apache Hadoop Tools ................................ SUCCESS [ 0.038 s]
[INFO] Apache Hadoop Distribution ......................... SUCCESS [ 47.384 s]
[INFO] Apache Hadoop Cloud Storage ........................ SUCCESS [ 2.062 s]
[INFO] Apache Hadoop Cloud Storage Project ................ SUCCESS [ 0.034 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------